<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增线索跟进记录')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-follow-add">
        	<input name="clueId" type="hidden" id="clueId" />
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">所属线索：</label>
                <div class="col-sm-8">
                	<div class="input-group">
                    	<input name="customerName" onclick="selectCustomer()" id="customerName" type="text" placeholder="请选择所属线索 " class="form-control" required readonly>
						<span class="input-group-addon"><i class="fa fa-search"></i></span>
					</div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">跟进时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="followDate" class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text" required>
                    </div>
                </div>
            </div>            
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">跟进类型：</label>
                <div class="col-sm-8">
                    <select name="followType" class="form-control m-b" th:with="type=${@dict.getType('follow_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">跟进结果：</label>
                <div class="col-sm-8">
                    <textarea name="followContent" class="form-control" required></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "crm/clueFollow"
        $("#form-follow-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-follow-add').serialize());
            }
        }

        $("input[name='followDate']").datetimepicker({
        });
        
        /*  跟进管理-新增-选择线索 */
        function selectCustomer() {
        	 var url = ctx + "crm/customer/selectCustomer";
        	 /* var options = {
				title: '选择线索',
				width: "780",
				url: url
			};
			$.modal.openOptions(options);
        	*/
        	 $.modal.open("选择线索", url);
		}
    </script>
</body>
</html>